package com.qf.test;

import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * Jedis连接池操作
 * @author zjw
 */
public class Demo3 {

    @Test
    public void pool(){
        //1. 创建连接池
        JedisPool pool = new JedisPool("192.168.41.98",6379);

        //2. 获取连接对象
        Jedis jedis = pool.getResource();

        //3. 操作
        String value = jedis.get("user");
        System.out.println(value);

        //4. 返还连接对象
        jedis.close();
    }


}
